All Functions of Week 8

order

{base}

Get indexes that will sort a vector

rm

{base}

Remove objects

mutate

{dplyr}

Modify/create a column in a data frame

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

predict

{stats}

Predict Probability

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

c

{base}

Combine values/vectors into a vector

summary

{base}

Obtain summary statistics or detailed regression output

which

{base}

return indexes of TRUE entries of a logical vector

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

colnames

{base}

Retrieve column names of a data frame

reorder

{stats}

Reorder Levels of Factor based on the values of a second variable, usually numeric.

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

geom_histogram

{GGPLOT2}

Generates a histogram

theme

{GGPLOT2}

Set theme for GGPLOT2

ifelse

{base}

Return a or b depending on the value of test

attach

{base}

Attach Set of R Objects to Search Path

dim

{base}

Get dimensions of a data frame

setwd

{base}

Set Working Directory

labs

{GGPLOT2}

Customise labels in GGPLOT2

confint

{stats}

Calculate confidence Intervals for Model Parameters

data.frame

{base}

Create a data.frame from vectors

with

{base}

evaluate expression in the context of a data frame

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

select

{dplyr}

Select columns from a tibble/data frame

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

cor

{stats}

Calculate Correlation Matrix

names

{base}

Retrieve names of a list/vector

scale_colour_manual

{GGPLOT2}

Create your own discrete scale

element_text

{GGPLOT2}

Customise text in GGPLOT2

coord_flip

{GGPLOT2}

Flip the x and y axes of a graph

mean

{base}

Get mean of a vector

ylab

{GGPLOT2}

Label the y axis (ggplot)

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

rbind

{base}

Combine R objects by rows

as.factor

{base}

Coerce a vector to factor

ggplot

{GGPLOT2}

Create a ggplot graph

library

{base}

Load an R package

xlab

{GGPLOT2}

Label the x axis (ggplot)

str

{utils}

Get the structure of an R object

filter

{dplyr}

Filter out rows of a data frame according to logical vector

geom_vline

{GGPLOT2}

Draws a vertical line

print

{base}

Print object to the console

lm

{base}

Fit a linear model

sum

{base}

Get sum of numeric values or a vector

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

stargazer

{stargazer}

Create a regression output table

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

geom_point

{GGPLOT2}

Generates a scatter plot

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

class

{base}

Retrieve class of an R object

head

{utils}

Show first 5 rows of a data frame

quantile

{stats}

Obtain empirical quantiles of a vector

The end!